<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增商户信息')" />
<th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-merchantinfo-add">
			<div class="form-group">
				<label class="col-sm-2 control-label"><span
					style="color: red;">*</span>商户名称：</label>
				<div class="col-sm-4">
					<input name="merchantName" class="form-control" type="text"
						required maxlength="20">
				</div>
				<label class="col-sm-2 control-label"><span
					style="color: red;">*</span>商户地址：</label>
				<div class="col-sm-4">
					<input name="merchantAddress" class="form-control" type="text"
						required maxlength="30">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span
					style="color: red;">*</span>所属部门：</label>
				<div class="col-sm-4">
					<input name="deptId" class="form-control" type="text" required>
				</div>

				<label class="col-sm-2 control-label">信用代码：</label>
				<div class="col-sm-4">
					<input name="merchantCreditCode" class="form-control" type="text"
						maxlength="50">
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label"><span
					style="color: red;">*</span>商户属性：</label>
				<div class="col-sm-4">
					<select name="merchantAttribute" class="form-control m-b"
						th:with="type=${@dict.getType('t_merchant_attribute')}" required>
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
							th:value="${dict.dictValue}"></option>
					</select>
				</div>

				<label class="col-sm-2 control-label"><span
					style="color: red;">*</span>商户状态：</label>
				<div class="col-sm-4">
					<div class="radio-box"
						th:each="dict : ${@dict.getType('t_merchant_status')}">
						<input type="radio" th:id="${'merchantStatus_' + dict.dictCode}"
							name="merchantStatus" th:value="${dict.dictValue}"
							th:checked="${dict.isDefault}" required> <label
							th:for="${'merchantStatus_' + dict.dictCode}"
							th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span
					style="color: red;">*</span>所在省份：</label>
				<div class="col-sm-4">
					<input name="cityCode" class="form-control" type="text" required>
				</div>
				<label class="col-sm-2 control-label"><span
					style="color: red;">*</span>所在城市：</label>
				<div class="col-sm-4">
					<input name="cityCode" class="form-control" type="text" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label"><span
					style="color: red;">*</span>商户简介：</label>
				<div class="col-sm-4">
					<textarea name="merchantBrief" class="form-control" required></textarea>

				</div>
				<label class="col-sm-2 control-label"><span
					style="color: red;">*</span>商户介绍：</label>
				<div class="col-sm-4">
					<textarea name="merchantIntroduce" class="form-control" required></textarea>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label"><span
					style="color: red;">*</span>商户图片：</label>
				<div class="col-sm-4">
					<input class="file" type="file" multiple data-min-file-count="1"
						accept="image/*" data-theme="fas" id="pic_file" name="pic_file">
				</div>
				<label class="col-sm-2 control-label">商户营业执照：</label>
				<div class="col-sm-4">
					<input class="file" type="file" multiple data-min-file-count="1"
						accept="image/*" data-theme="fas" id="pic_file" name="pic_file">
					<span class="help-block m-b-none"><i
						class="fa fa-info-circle"></i> 提示：请上传正确的营业执照，否则将无法通过审核</span>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: bootstrap-fileinput-js" />

	<script type="text/javascript">
		var prefix = ctx + "bussiness/merchantinfo"
		$("#form-merchantinfo-add").validate({
			focusCleanup : true
		});

		function submitHandler() {
			if ($.validate.form()) {
				$.operate.save(prefix + "/add", $('#form-merchantinfo-add')
						.serialize());
			}
		}
	</script>
</body>
</html>